<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			.hd{
				width: 400px;
				height: 300px;
				border: 4px solid red;
				float: left;
				margin: 10px;
				position: relative;
			}
			.pic{
				width: 200px;
				border: 2px solid green;
				position: absolute;
				left: 200px;
				bottom: 0;
			}
		</style>
		<script src='jquery-3.4.1.js'></script>
		<script type="text/javascript">
			$(function(){
				//给div加鼠标移入事件
				$('.hd').mouseenter(function(){
					//$(".hd .pic").stop().animate({'left':'170px'},300);
					$(this).find('.pic').stop().animate({'left':'170px'},300);
				})
				//给div加鼠标移出事件
				$(".hd").mouseleave(function(){
					$(this).find('.pic').stop().animate({'left':'200px'},300);
				})
				
			})
		</script>
	</head>
	<body>
		<div class="hd">
			<img src="../../javascript/上课笔记/img/1.jpg" class='pic'/>
		</div>
		<div class="hd">
			<img src="../../javascript/上课笔记/img/1.jpg" class='pic'/>
		</div>
		<div class="hd">
			<img src="../../javascript/上课笔记/img/1.jpg" class='pic'/>
		</div>
		<div class="hd">
			<img src="../../javascript/上课笔记/img/1.jpg" class='pic'/>
		</div>
		<div class="hd">
			<img src="../../javascript/上课笔记/img/1.jpg" class='pic'/>
		</div>
		<div class="hd">
			<img src="../../javascript/上课笔记/img/1.jpg" class='pic'/>
		</div>
		<div class="hd">
			<img src="../../javascript/上课笔记/img/1.jpg" class='pic'/>
		</div>
		<div class="hd">
			<img src="../../javascript/上课笔记/img/1.jpg" class='pic'/>
		</div>
		<div class="hd">
			<img src="../../javascript/上课笔记/img/1.jpg" class='pic'/>
		</div>
	</body>
</html>

